package com.xcity.game.item.effect;

import com.xcity.db.entity.Player;
import com.xcity.game.common.Cause;
import com.xcity.game.item.GameItem;
import com.xcity.game.item.ItemEffect;
import com.xcity.game.item.listener.BagListener;

/**
 * 获得钻石的物品使用效果
 * @author YangLi
 *
 */
public class AddStoneEffect implements ItemEffect {

	@Override
	public boolean effect(Player player, GameItem item, int count, BagListener listener) {
		int[] params = item.getTemplate().getParams();
		if (params != null && params.length > 0) {
			player.addStone(params[0] * count, Cause.USE_ITEM);
			return true;
		}
		return false;
	}

}
